#include "thread_pool.hpp"
#include "Task.hpp"

#include <ctime>
#include <cstdlib>

using namespace Mango;

int main()
{
    //创建一个任务队列
    ThreadPool<Task>* tp = new ThreadPool<Task>();
    tp->InitThreadPool();//初始化线程池
    srand((long long)time(nullptr));
    const char* str = "+-*/%";
    while(1)
    {
        sleep(1);
        //主线程放任务
        Task t(rand()%20+1, rand()%10+1, str[rand()%5]);
        tp->PushTask(t);
    }
    return 0;
}
